package cz.uhk.ppro.entities;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;



@Entity
public class Dodavatel implements Serializable{
	/**
	 * Dodavatel zboží
	 */
	
	private static final long serialVersionUID = 1L;
	private String psc, cisloPopisne, nazevFirmy, ulice, mesto;
	@Id
	@GeneratedValue
	private int id;
	@OneToMany(mappedBy = "dodavatel") 
	private Collection<Dil> dily;
	
	@OneToMany(mappedBy = "dodavatel", fetch = FetchType.EAGER) 
	private Collection<KontaktniOsoba> kontaktniOsoby;
	
	public Dodavatel() {
	}

	public String getPsc() {
		return psc;
	}

	public void setPsc(String psc) {
		this.psc = psc;
	}

	public String getCisloPopisne() {
		return cisloPopisne;
	}

	public void setCisloPopisne(String cisloPopisne) {
		this.cisloPopisne = cisloPopisne;
	}


	public String getNazevFirmy() {
		return nazevFirmy;
	}

	public void setNazevFirmy(String nazevFirmy) {
		this.nazevFirmy = nazevFirmy;
	}

	public String getUlice() {
		return ulice;
	}

	public void setUlice(String ulice) {
		this.ulice = ulice;
	}

	public String getMesto() {
		return mesto;
	}

	public void setMesto(String mesto) {
		this.mesto = mesto;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Collection<Dil> getDily() {
		return dily;
	}

	public void setDily(Collection<Dil> dily) {
		this.dily = dily;
	}

	public Collection<KontaktniOsoba> getKontaktniOsoby() {
		return kontaktniOsoby;
	}

	public void setKontaktniOsoby(Collection<KontaktniOsoba> kontaktniOsoby) {
		this.kontaktniOsoby = kontaktniOsoby;
	}
	
	public String toString(){
		return this.nazevFirmy;
	}
}
